First of all, You should have installed Database, I think Mysql is good. And you should already intalled gcc, make tools, and some other libs.
Here is a sample
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-serversYou probably need some source codes . Blow is a list:
Ruby , you can download it here. http://www.ruby-lang.org/
Ruby Gem, http://rubygems.org
It is quite simple to install Ruby on rails on CentOS.
Step 1, install ruby ,very simple
tar zxvf ruby-1.8.7-p174.tar.gz
cd ruby-1.8.7-p174
./configure
make && make install
Step 2, install ruby gem
tar zxvf rubygems-1.8.10.tgz
cd rubygems-1.8.10
./configure
make && make install
Step 3, install rails
sudo gem install rails
If you are in China , You should change your gem source. Taobao gives us a very nice solution.
Here is the link , http://ruby.taobao.org/ , just follow it to change the gem source.
Step 4, install Nginx and Passenger through gem
gem install passenger
passenger-install-nginx-module
Then follow the guide , download the newest version of nginx , then tell it where to install Nginx.
It will do it automaticly.
After this, you will get two line of nginx configuration, such as
passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.13;
passenger_ruby /usr/local/bin/ruby;
it may a little different. like the passenger version is what you installed.
That’s all. Now it’s time to confige the Nginx host.
server {
listen 80;
server_name your_application_domain;
root /your_application_path/public;
passenger_enabled on;
rails_env development;
}
Edit your host file , /etc/hosts.
Start nginx.
That’s all. Enjoy!